//
//  AboutViewController.m
//  MyLittleBrother
//
//  Created by speeda on 17/8/1.
//  Copyright © 2017年 speeda. All rights reserved.
//

#import "AboutViewController.h"

@interface AboutViewController () <UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *aboutTableView;
@property (nonatomic, strong) NSArray *aboutArray;

@end

@implementation AboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initView];
}

- (void)initView {

    self.title = @"关于";
    self.aboutTableView.dataSource = self;
    self.aboutTableView.delegate = self;
    self.aboutTableView.estimatedRowHeight = 100;
    self.aboutTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.aboutTableView.rowHeight = UITableViewAutomaticDimension;
    self.aboutTableView.tableFooterView = [[UIView alloc] init];
    self.aboutTableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
}





#pragma maek -- UITableViewDataSource,UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.aboutArray.count;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *settingCell = @"settingCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:settingCell];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:settingCell];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    
    cell.textLabel.text = self.aboutArray[indexPath.row];
    
    return cell;
}


- (NSArray *)aboutArray {

    if (!_aboutArray) {
        _aboutArray = @[@"服务协议",@"使用帮助",@"当前版本"];
    }
    
    return _aboutArray;
}

@end
